import { request } from '@umijs/max';

const url='/admin/z_menu'

export async function post_save_api(Req: MenuApi.Dto) {
  return request<ResponseApi.ResUnifyFormat<boolean>>(`${url}/saveOrUpate`, {
    method: 'POST',
    data: Req,
  });
}

export async function get_list_all_api() {
  return request<ResponseApi.ResUnifyFormat<MenuApi.List[]>>(
    `${url}/findMenuTreeList`,
    {
      method: 'GET',
    },
  );
}

export async function delete_api(ID: string) {
  return request<ResponseApi.ResUnifyFormat<boolean>>(`${url}/delete?id=${ID}`, {
    method: 'GET',
  });
}

export async function delete_batch_api(IDs: (string | number)[]) {
  return request<ResponseApi.ResUnifyFormat<boolean>>(`${url}/batchDelete`, {
    method: 'POST',
    data: IDs,
  });
}
